import 'package:flutter/material.dart';
import 'package:oramemo/common/styles/colors.dart';

class TranscriptItem extends StatelessWidget {
  final String time;
  final String text;
  final Function()? onTap;
  final bool isBookmarked;
  final bool isSelected;

  const TranscriptItem({
    required this.time,
    required this.text,
    this.onTap,
    this.isBookmarked = false,
    this.isSelected = false,
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Padding(
        padding: const EdgeInsets.only(bottom: 16),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Container(
              width: 5,
              height: 5,
              margin: const EdgeInsets.only(top: 8),
              decoration: BoxDecoration(
                color: isBookmarked ? Colors.orange : Colors.blue,
                shape: BoxShape.circle,
              ),
            ),
            const SizedBox(width: 8),
            Expanded(
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    children: [
                      Text(
                        time,
                        style: TextStyle(
                          color: isBookmarked ? Colors.orange : Colours.text,
                        ),
                      ),
                      if (isBookmarked)
                        const Padding(
                          padding: EdgeInsets.only(left: 4),
                          child: Icon(
                            Icons.bookmark,
                            size: 14,
                            color: Colors.orange,
                          ),
                        ),
                    ],
                  ),
                  const SizedBox(height: 4),
                  Text(
                    text,
                    style: TextStyle(
                      fontSize: 16,
                      height: 1.5,
                      color: isSelected ? Colours.text : Colours.text,
                      fontWeight:
                          isSelected ? FontWeight.bold : FontWeight.normal,
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
